package com.pmcc.cj.repository;

import com.pmcc.cj.entity.CjPosition;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by tomas on 2020/9/21.
 */
public interface CjPositionRepository extends JpaRepository<CjPosition,String> {
    @Modifying
    @Query(value ="select DISTINCT(customer_id) from cj_position ",  nativeQuery = true)
    List findByCustomerGroup();
    List<CjPosition> findByCustomerIdOrderByCreateTimeDesc(String customerId);
}
